﻿using System;
using System.Collections.Generic;
using System.Web;
using Exam.Core;

/// <summary>
///AdminPageBase 的摘要说明
/// </summary>
public class AdminPageBase :  System.Web.UI.Page {

    private int userId = 0;
    public bool isLogin = false;
    protected Exam.Core.Model.Admin isTheMe;

	public AdminPageBase(){}

    protected void AdminPage_Load(object sender, System.EventArgs e) {

    }
    protected void AdminPage_Error(object sender, System.EventArgs e) {
        Exception currentError = Server.GetLastError();
        //this.WriteException(currentError);
        //GotoErrorPage("", "您的操作出现了错误，错误原因：" + currentError.Message.ToString(), Request.RawUrl);
        //Server.ClearError();
    }
    protected override void OnInit(EventArgs e) {
        base.OnInit(e);
        this.Load += new System.EventHandler(this.AdminPage_Load);
        this.Error += new System.EventHandler(this.AdminPage_Error);
        CheckLogin();
        if (!isLogin) {
            //Response.Redirect("login.aspx");
            Response.Redirect(Utils.RelativeWebRoot + "login.aspx", true);
        }

    }
    private void CheckLogin() {
        string tmp = Cookie.GetCookie(ExamSys.admin_cookiesname.Trim()).Trim();
        if (tmp != "") {
            string[] str = tmp.Split('|');
            
            isLogin = true;
        }


    }

}